package com.weitu.permission.post.service.impl;

import com.weitu.permission.post.entity.Post;
import com.weitu.permission.post.mapper.PostMapper;
import com.weitu.permission.post.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author zhangqingxi 2017/6/6
 */
@Service
public class PostServiceImpl implements PostService {
    private final PostMapper postMapper;

    @Autowired
    public PostServiceImpl(PostMapper postMapper) {
        this.postMapper = postMapper;
    }

    @Override
    public List<Post> findByParam(Map paramMap) {
        return postMapper.findByParam(paramMap);
    }

    @Override
    public Integer findByParamCount(Map paramMap) {
        return postMapper.findByParamCount(paramMap);
    }

    @Override
    public Post findById(String id) {
        return postMapper.findById(id);
    }

    @Override
    public Post findByCode(String code) {
        return postMapper.findByCode(code);
    }

    @Override
    public List<Map> findByDeptId(String deptId) {
        return postMapper.findByDeptId(deptId);
    }

    @Override
    public Integer add(Map paramMap) {
        return postMapper.add(paramMap);
    }

    @Override
    public Integer updateById(Map paramMap) {
        return postMapper.updateById(paramMap);
    }
}
